home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / Kubuntu 8.10 / kubuntu-8.10-desktop-i386.iso / casper / filesystem.squashfs / var / lib / dpkg / info / procps.postinst < prev    next >
Text File  |  2008-10-27  |  3KB  |  114 lines

  1. #!/bin/sh
  2. # postinst script for procps
  3. #
  4. # see: dh_installdeb(1)
  5.  
  6. set -e
  7.  
  8. # summary of how this script can be called:
  9. #        * <postinst> `configure' <most-recently-configured-version>
  10. #        * <old-postinst> `abort-upgrade' <new version>
  11. #        * <conflictor's-postinst> `abort-remove' `in-favour' <package>
  12. #          <new-version>
  13. #        * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
  14. #          <failed-install-package> <version> `removing'
  15. #          <conflicting-package> <version>
  16. # for details, see http://www.debian.org/doc/debian-policy/ or
  17. # the debian-policy package
  18. #
  19. # quoting from the policy:
  20. #     Any necessary prompting should almost always be confined to the
  21. #     post-installation script, and should be protected with a conditional
  22. #     so that unnecessary prompting doesn't happen if a package's
  23. #     installation fails and the `postinst' is called with `abort-upgrade',
  24. #     `abort-remove' or `abort-deconfigure'.
  25.  
  26. # Move a conffile without triggering a dpkg question
  27. mv_conffile() {
  28.   OLDCONFFILE="$1"
  29.   NEWCONFFILE="$2"
  30.  
  31.   if [ -e "$OLDCONFFILE" ]; then
  32.     echo "Preserving user changes to $NEWCONFFILE ..."
  33.     mv -f "$NEWCONFFILE" "$NEWCONFFILE".dpkg-new
  34.     mv -f "$OLDCONFFILE" "$NEWCONFFILE"
  35.   fi
  36. }
  37.  
  38. case "$1" in
  39.     configure|abort-remove|abort-deconfigure)
  40.         if [ -e /etc/psdevtab ] ; then
  41.             rm -f /etc/psdevtab
  42.         fi
  43.         if [ -e /etc/psdatabase ] 
  44.         then
  45.             rm -f /etc/psdatabase
  46.         fi
  47.        # Remove old procps init.d script, if it exists Closes: #55137
  48.        if [ -L /etc/rcS.d/S30procps.sh ]
  49.        then
  50.           update-rc.d -f procps.sh remove >/dev/null
  51.        fi
  52.        # and if that didn't work Closes: #92184 (#234306 with -L )
  53.        if [ -L /etc/rcS.d/S30procps.sh ]
  54.        then
  55.            rm -f /etc/rcS.d/S30procps.sh
  56.        fi
  57.        if [ -L /etc/rcS.d/S05procps.sh ]; then
  58.            rm -f /etc/rcS.d/S05procps.sh
  59.        fi
  60.        # Ubuntu had this link at S17, leaving cruft behind on upgrade:
  61.        if [ -L /etc/rcS.d/S17procps.sh ]; then
  62.            rm -f /etc/rcS.d/S17procps.sh
  63.        fi
  64.        # Remove moved procps.sh file, if it is there
  65.        if dpkg --compare-versions "$2" le "1:3.2.7-3"; then
  66.          mv_conffile "/etc/init.d/procps.sh" "/etc/init.d/procps"
  67.        fi
  68.         
  69.         #
  70.         # Now to do the alternatives for w and ps
  71.         update-alternatives --install /usr/bin/w w /usr/bin/w.procps 50 \
  72.             --slave /usr/share/man/man1/w.1.gz w.1.gz /usr/share/man/man1/w.procps.1.gz
  73.         
  74.     ;;
  75.  
  76.     abort-upgrade)
  77.         # Nothing to do
  78.     ;;
  79.  
  80.     *)
  81.         echo "postinst called with unknown argument \`$1'" >&2
  82.         exit 1
  83.     ;;
  84. esac
  85.  
  86. # dh_installdeb will replace this with shell code automatically
  87. # generated by other debhelper scripts.
  88.  
  89. # Automatically added by dh_installmenu
  90. if [ "$1" = "configure" ] && [ -x "`which update-menus 2>/dev/null`" ]; then
  91.     update-menus
  92. fi
  93. # End automatically added section
  94. # Automatically added by dh_installinit
  95. if [ -x "/etc/init.d/procps" ]; then
  96.     update-rc.d procps start 17 S . >/dev/null
  97.     if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
  98.         invoke-rc.d procps start || exit $?
  99.     else
  100.         /etc/init.d/procps start || exit $?
  101.     fi
  102. fi
  103. # End automatically added section
  104. # Automatically added by dh_makeshlibs
  105. if [ "$1" = "configure" ]; then
  106.     ldconfig
  107. fi
  108. # End automatically added section
  109.  
  110.  
  111. exit 0
  112.  
  113.  
  114.